﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using Antu.WebControls;
using Antu.Core.Components;
using Antu.Core.Services;
using System.Web.UI.WebControls;
using EluZSProvider;
using System.Web;
using System.Data;

namespace WebSys.UI.Control.ZhengShou
{
    public class ZS_ZNMessageControl : MPBasicTemplate
    {
        EluZSDataProvider _EluZSDataProvider = (EluZSDataProvider)ProviderService.ProviderServiceMange.GetProvider("EluZSProvider");
        TextBox txt发送标题, txt发送内容, txt评估机构;
        public string userid = string.Empty;
        protected override void OnLoad(EventArgs e)
        {
            if (HttpContext.Current.Session["UserID"] == null)
            {
                Antu.Utilities.UtilitiesPage.AlertDialogClear("登录超时，请重新登录！", "window.parent.location.href('../login.aspx');");
            }
            else
            {
                userid = HttpContext.Current.Session["UserID"].ToString();
            }
            base.OnLoad(e);
            txt发送标题 = (TextBox)FindControl("txt发送标题");
            txt发送内容 = (TextBox)FindControl("txt发送内容");
            txt评估机构 = (TextBox)FindControl("txt评估机构");
            Button btnSend = (Button)FindControl("btnSend");
            btnSend.Click += new EventHandler(btnSend_Click);
        }
        protected void btnSend_Click(object sender, EventArgs e)
        {
            string luserid = userid;
            string ltime = System.DateTime.Now.ToString();
            string fsbt = txt发送标题.Text.Trim();
            string fsnr = txt发送内容.Text.Trim();
            string pgjg = txt评估机构.Text.Trim();
            string[] tt = pgjg.Split(',');
            if (tt.Length > 0)
            {
                _EluZSDataProvider.FSZNMessage(luserid, ltime, fsbt, fsnr, pgjg);
                Antu.Utilities.UtilitiesPage.AlertDialog("发送成功！", "location.href=location.href;");
            }
        }
    }
}


